ForkMind 🧠

Local-first LLM state branching, debugging & context capsules.

Treat AI context windows like a Git repo. Capture, visualize, branch, and regression-test LLM calls as a DAG β€” and offload context into encrypted, restorable capsules instead of truncating it. Free & local via Ollama, any OpenAI-compatible API, and MCP for agents. Zero config, no cloud, no account.

npm MIT CI Node >=18 Contributing Contributors
# from npm
npx forkmind start
# …or straight from the git link
npx github:medhovarsh/forkmind start
ForkMind dashboard demo: conversation DAG, node inspector, fork dialog

The dashboard: a conversation tree with a branch off the root, the node inspector (request/response, tokens, provenance), and the Fork dialog.

What it does

🌳

Branch like Git

Every LLM call is a node in a DAG. Fork an alternative prompt or model from any historical turn.

πŸ†“

Free & local

Defaults to open-source models via Ollama. No API key, no database, no telemetry.

πŸ”Œ

Any provider

Provider-agnostic proxy. OpenAI, Groq, OpenRouter, Together, LM Studio, vLLM, Anthropic.

πŸ“‘

Streaming

Bytes pass through untouched; the proxy reconstructs the full message β€” text and tool calls.

πŸ€–

MCP for agents

An agent can query its own history mid-task β€” recall attempts, trace lineage, self-correct.

βœ…

Regression tests

Pin good outputs as baselines, re-run after prompt tweaks, catch drift in CI.

πŸ’Š

Context capsules

Offload context as an immutable, AES-256-GCM-encrypted DAG. Save β†’ verify β†’ compact; restore full or per segment; crypto-shred to forget.

πŸ›‘οΈ

RAID redundancy

Redundant Array of Independent DAGs: mirror capsules across disks with self-healing restore. Keys never replicated.

Quick start

# 1. a free local model (install Ollama from ollama.com)
ollama pull llama3

# 2. start ForkMind (proxy + dashboard on :4500)
npx github:medhovarsh/forkmind start

# 3. point your OpenAI client at the proxy
#    baseURL: http://localhost:4500/v1
#    open http://localhost:4500 for the dashboard

Full documentation on GitHub β†’

FAQ

What is ForkMind?

ForkMind is a local-first tool that treats AI context windows like a Git repository. It captures every LLM call into a local .forkmind directory, visualizes the conversation as a Directed Acyclic Graph (DAG), and lets you branch alternative prompts or models from any historical turn β€” all on your machine, no cloud, no account.

Is ForkMind free?

Yes. ForkMind is MIT-licensed and runs entirely on your machine. It defaults to free, open-source models via Ollama β€” no API key, no database, no telemetry.

Which LLM providers does ForkMind support?

ForkMind is a provider-agnostic proxy. It works with any OpenAI-compatible API, including Ollama, OpenAI, Anthropic, Groq, OpenRouter, Together, LM Studio, and vLLM.

How do I install ForkMind?

ForkMind runs straight from its git link β€” no npm registry needed. Run npx github:medhovarsh/forkmind start to launch the proxy and dashboard on port 4500, then point your OpenAI client at http://localhost:4500/v1.

How can AI agents use ForkMind?

ForkMind exposes an MCP (Model Context Protocol) server with tools for history (recent turns, lineage, branches, search) and context capsules (save, digest, restore, forget, replica health). An agent can recall previous attempts mid-task, self-correct, archive finished context to shrink its window, and restore it later.

What are ForkMind context capsules?

Capsules save conversation context as an immutable, encrypted DAG snapshot on disk so it can be removed from the live model window instead of truncated and lost. Segments are content-addressed (hashed over content + parents, like Git) β€” immutable and acyclic by construction. AES-256-GCM encryption with keys stored outside the data directory. Restore in full or one segment at a time. The workflow is save β†’ verify on disk β†’ compact: nothing is dropped until it is provably persisted.

How does ForkMind delete context securely?

Crypto-shredding: forgetting a capsule destroys its encryption key first, tombstones the id so identical content can never resurrect it, then removes ciphertext everywhere β€” including replicas. Backups of the ciphertext stay unreadable because the key is gone.

What is RAID in ForkMind?

Redundant Array of Independent DAGs. Mirror capsules to extra filesystem targets (second disk, synced folder, network mount). Replicas hold ciphertext + manifests only β€” keys are never replicated. On primary loss or bit-rot, restore self-heals from the first replica that passes verification; tombstones propagate on sync.

Does ForkMind modify the LLM or its cache?

No. ForkMind operates entirely at the context-assembly layer β€” it changes what the client sends, never the provider, model weights, or KV cache. Offloading just means the provider receives a shorter message list plus a one-line capsule handle.